<template>
<!--  <div class="hello">
    <h1 @click="getUserPage()">{{ msg }}</h1>
  
  </div> -->
  <div>
  	<div class="headbar" >我的智能设备</div>
  	<div class="">
  		<div class="image-view">
			<img src="../assets/kit.jpg" alt="">
  		</div>
  		<div class="text-view">
  			账号绑定成功
  		</div>
  		<div class="button" @click="close()">
  			确认
  		</div>
  	</div>
  </div>
</template>
<script>

//引入userPage请求
import {userPage} from "@/api/user/user";


export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },


  methods: {
	  close(){
		
		   console.log("调用uni.postMessage，开始发送");
			  this.myUni.webView.postMessage({  
			  		data: {  
			  			action: "success",  
			  		},  
			  	});  

			   
		
	  },
	 
    //该组件中的方法
    getUserPage() {
      //调用分页显示用户api接口
	  let form = {
    "userId": "109",
    "start": "2022-03-07",
    "end": "2022-03-13"
}
	  // form.id_of_user = 2284
      userPage(form)
          .then(res => {
            console.log(res)
			// this.msg=res
          })
          .catch(err => {
            console.log(err)
          })
    }	
  }
}
</script>

<style >
.headbar{
	top: 40px;
	width: 200px;
	margin-left: -100px;
	left: 50%;
	position: absolute;
	font-size: 22px;
	font-weight: 800;
}
.image-view{
	
	margin: 60px auto;
	margin-top: 150px;
	width: 100px;
	height: 100px;
}
.image-view img{
	width: 100px;
	height: 100px;
}
.text-view{
	margin: 20px auto;
	text-align: center;
}
.button{
	position: absolute;
	border-radius: 20px;
	left: 50%;
	margin-left: -150px;
	bottom:100px;
	width: 300px;
	height: 35px;
	background: rgba(255, 187, 36, 0.39);
	background-color: #FFBB24;
	color: #ffffff;
	opacity: 1;
	text-align: center;
	line-height: 35px;
	font-size: 20px;
}
</style>
